<template>
  <div class="leave-detail-page">
    <!-- 步骤导航 -->
    <div class="step-nav">
      <div class="step-item active">
        <div class="step-num">1</div>
        <div class="step-text">申请请假</div>
      </div>
      <div class="step-item active">
        <div class="step-num">2</div>
        <div class="step-text">申请审批</div>
      </div>
      <div class="step-item active">
        <div class="step-num">3</div>
        <div class="step-text">请假审批</div>
      </div>
    </div>

    <!-- 主要内容区域 - 上下结构 -->
    <div class="main-content vertical-layout">
      <!-- 审批状态卡片 -->
      <el-card class="info-card status-card">
        <div class="card-header">
          <div class="section-title">审批中</div>
        </div>
        <div class="status-content">
          <div class="status-tip">
            稍等，请假申请单正在审批中，若该申请单长时间未处理，请联系（审批角色）！
          </div>
        </div>
      </el-card>

      <!-- 操作记录卡片 -->
      <el-card class="info-card record-card">
        <div class="card-header">
          <div class="section-title">操作记录</div>
        </div>
        <div class="record-content">
          <!-- 发起申请记录 -->
          <div class="record-item">
            <div class="record-main">发起申请-申请请假</div>
            <div class="record-detail">
              <div class="record-user">原延停（已发起）</div>
              <div class="record-time">2018-10-15 09:00:00</div>
            </div>
          </div>

          <!-- 审批记录 -->
          <div class="record-item">
            <div class="record-main">（角色）审批-申请审批</div>
            <div class="record-detail">
              <div class="record-user">盛明兰（审批中）</div>
            </div>
          </div>
        </div>
      </el-card>
    </div>

    <!-- 返回按钮 -->
    <div class="action-buttons">
      <el-button type="primary" @click="handleBack" class="back-btn">
        返回
      </el-button>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { ElCard, ElButton } from 'element-plus'

const router = useRouter()
const approvalFormRef = ref()

// 返回按钮
const handleBack = () => {
  router.push({
    name: 'LeaveRequest'
  })
};
</script>

<style scoped>
.leave-detail-page {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.step-nav {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 50px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-item::before {
  content: '';
  position: absolute;
  top: 15px;
  left: -50%;
  width: 100%;
  height: 2px;
  background-color: #e5e7eb;
  z-index: 1;
}

.step-item:first-child::before {
  display: none;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: #409eff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  position: relative;
  z-index: 2;
  font-size: 14px;
}

.step-item.active .step-num {
  background-color: #409eff;
}

.step-item:not(.active) .step-num {
  background-color: #dcdcdc;
}

.step-text {
  color: #606266;
  font-size: 14px;
}

.step-item.active .step-text {
  color: #409eff;
  font-weight: 500;
}

/* 主要内容区域 - 上下结构 */
.main-content.vertical-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.info-card {
  margin-bottom: 0;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}

/* 审批状态卡片样式 */
.status-card {
  min-height: 120px;
}

.status-content {
  padding: 10px 0;
}

.status-tip {
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
  background: #f0f9ff;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid #409eff;
}

/* 操作记录卡片样式 */
.record-card {
  min-height: 200px;
}

.record-content {
  padding: 10px 0;
}

.record-item {
  margin-bottom: 24px;
  padding: 16px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
}

.record-item:last-child {
  margin-bottom: 0;
}

.record-main {
  font-size: 14px;
  font-weight: 600;
  color: #303133;
  margin-bottom: 8px;
}

.record-detail {
  padding-left: 12px;
}

.record-user {
  font-size: 13px;
  color: #606266;
  margin-bottom: 4px;
}

.record-time {
  font-size: 12px;
  color: #909399;
}

.action-buttons {
  text-align: center;
  margin-top: 30px;
  padding: 20px 0;
}

.action-buttons .el-button {
  margin: 0 10px;
  min-width: 100px;
}

.back-btn {
  width: 120px;
  height: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .step-nav {
    padding: 0 20px;
  }

  .record-item {
    padding: 12px;
  }
}
</style>